#!/bin/bash

# Use this environment with GC-Classic, GCHP, and ESMF on SLES15, e.g. milan ('ssh discover-mil')
# See also https://spack-stack.readthedocs.io/en/latest/PreConfiguredSites.html#nasa-discover-scu17

module purge

module use /discover/swdev/gmao_SIteam/modulefiles-SLES15
module use /discover/swdev/jcsda/spack-stack/scu17/modulefiles
module load ecflow/5.11.4

module use /gpfsm/dswdev/jcsda/spack-stack/scu17/spack-stack-1.7.0/envs/ue-intel-2021.10.0/install/modulefiles/Core
module load stack-intel/2021.10.0
module load stack-intel-oneapi-mpi/2021.10.0

module load stack-python/3.10.13
module load cmake/3.28.2
module load git/2.42.0
module load netcdf-fortran/4.6.1

umask 022

export CC=icc
export CXX=icpc
export FC=ifort

# MPI
export MPI_ROOT=${MPI_HOME}

# For ESMF
export ESMF_COMPILER=intel
export ESMF_COMM=intelmpi
export ESMF_DIR=/gpfsm/dnb06/projects/p113/ewlundgr/GCHP/ESMF
export ESMF_INSTALL_PREFIX=${ESMF_DIR}/INSTALL_SLES15_stack-intel-2021.10.0

# For GCHP
export ESMF_ROOT=${ESMF_INSTALL_PREFIX}

ulimit -l unlimited
ulimit -u 50000
ulimit -v unlimited
ulimit -s unlimited
OMP_STACKSIZE=500m
